package com.mycompany.goodsys.core.SearchGoodView;

import com.mycompany.goodsys.core.AppEntity.AppObj;
import java.util.List;

public class SearchGoodsData {
    private static boolean is_set = false;
    private static List<AppObj> list = null;
    public static void Init() {
    }

    public static void SetObj(List<AppObj> list){
        SearchGoodsData.list = list;
        is_set = true;
    }

    public static String GetListInfo(){
        String ss = "搜索结果：\n";;
        if(list == null || list.size() <= 0){
            ss = is_set ? ss + "没有相关搜索结果\n" : "";
            return ss;
        }

        for(AppObj obj : list){
            String format = "\t" + "guid : %32s\t\t"  + "name : %5s\t\t" + "number: %5s\n";
            String str = String.format(format,obj.GetGuid(),obj.GetName(),obj.GetNumber());
            ss = ss + str;
        }

        return ss;
    }
}
